package com.member.shop.service.impl;

import java.util.Arrays;
import java.util.List;
        import com.member.common.utils.DateUtils;
import javax.annotation.Resource;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import com.member.shop.mapper.SysBizActivityGoodsMapper;
import com.member.shop.domain.SysBizActivityGoods;
import com.member.shop.service.ISysBizActivityGoodsService;

/**
 * 参与活动商品Service业务层处理
 *
 * @author lixinchen
 * @date 2024-11-09
 */
@Service
public class SysBizActivityGoodsServiceImpl extends ServiceImpl<SysBizActivityGoodsMapper, SysBizActivityGoods> implements ISysBizActivityGoodsService
{
    @Resource
    private SysBizActivityGoodsMapper sysBizActivityGoodsMapper;

    /**
     * 查询参与活动商品
     *
     * @param id 参与活动商品主键
     * @return 参与活动商品
     */
    @Override
    public SysBizActivityGoods selectSysBizActivityGoodsById(Long id)
    {
        return sysBizActivityGoodsMapper.selectById(id);
    }

    /**
     * 查询参与活动商品列表
     *
     * @param queryWrapper 参与活动商品
     * @return 参与活动商品
     */
    @Override
    public List<SysBizActivityGoods> selectSysBizActivityGoodsList(LambdaQueryWrapper<SysBizActivityGoods> queryWrapper)
    {
        return sysBizActivityGoodsMapper.selectList(queryWrapper);
    }

    @Override
    public List<SysBizActivityGoods> selectSysBizActivityGoodsList(SysBizActivityGoods sysBizActivityGoods) {
        return sysBizActivityGoodsMapper.selectSysBizActivityGoodsList(sysBizActivityGoods);
    }

    /**
     * 新增参与活动商品
     *
     * @param sysBizActivityGoods 参与活动商品
     * @return 结果
     */
    @Override
    public int insertSysBizActivityGoods(SysBizActivityGoods sysBizActivityGoods)
    {
                sysBizActivityGoods.setCreateTime(DateUtils.getNowDate());
            return sysBizActivityGoodsMapper.insert(sysBizActivityGoods);
    }

    /**
     * 修改参与活动商品
     *
     * @param sysBizActivityGoods 参与活动商品
     * @return 结果
     */
    @Override
    public int updateSysBizActivityGoods(SysBizActivityGoods sysBizActivityGoods)
    {
                sysBizActivityGoods.setUpdateTime(DateUtils.getNowDate());
        return sysBizActivityGoodsMapper.updateById(sysBizActivityGoods);
    }

    /**
     * 批量删除参与活动商品
     *
     * @param ids 需要删除的参与活动商品主键
     * @return 结果
     */
    @Override
    public int deleteSysBizActivityGoodsByIds(Long[] ids)
    {
        return sysBizActivityGoodsMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除参与活动商品信息
     *
     * @param id 参与活动商品主键
     * @return 结果
     */
    @Override
    public int deleteSysBizActivityGoodsById(Long id)
    {
        return sysBizActivityGoodsMapper.deleteById(id);
    }
}
